home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Sound.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  60.6 KB  |  1,456 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.3
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1986-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Sound;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __SOUND__}
  27. {$SETC __SOUND__ := 1}
  28.  
  29. {$I+}
  30. {$SETC SoundIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __DIALOGS__}
  37. {$I Dialogs.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __COMPONENTS__}
  40. {$I Components.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __MIXEDMODE__}
  43. {$I MixedMode.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __MOVIES__}
  46. {$I Movies.p}
  47. {$ENDC}
  48.  
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54. {
  55.                         * * *  N O T E  * * *
  56.  
  57.     This file has been updated to include Sound Manager 3.3 interfaces.
  58.  
  59.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  60.     that originally shipped with the PowerMacs. These missing functions and the
  61.     new 3.3 interfaces have been released in the SoundLib library for PowerPC
  62.     developers to link with. The runtime library for these functions are
  63.     installed by the Sound Manager. The following functions are found in SoundLib.
  64.  
  65.         GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  66.         UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  67.         SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  68.         SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  69.         SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  70.         AudioGetBass(), AudioGetInfo(), AudioGetMute(), AudioGetOutputDevice(),
  71.         AudioGetTreble(), AudioGetVolume(), AudioMuteOnEvent(), AudioSetBass(),
  72.         AudioSetMute(), AudioSetToDefaults(), AudioSetTreble(), AudioSetVolume(),
  73.         OpenMixerSoundComponent(), CloseMixerSoundComponent(), SoundComponentAddSource(),
  74.         SoundComponentGetInfo(), SoundComponentGetSource(), SoundComponentGetSourceData(),
  75.         SoundComponentInitOutputDevice(), SoundComponentPauseSource(),
  76.         SoundComponentPlaySourceBuffer(), SoundComponentRemoveSource(),
  77.         SoundComponentSetInfo(), SoundComponentSetOutput(), SoundComponentSetSource(),
  78.         SoundComponentStartSource(), SoundComponentStopSource(),
  79.         ParseAIFFHeader(), ParseSndHeader(), SoundConverterGetInfo(), SoundConverterSetInfo()
  80. }
  81. {
  82.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  83.  
  84.     These items are no longer defined, but appear here so that someone
  85.     searching the interfaces might find them. If you are using one of these
  86.     items, you must change your code to support the Sound Manager.
  87.  
  88.         swMode, ftMode, ffMode
  89.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  90.         SndCompletionProcPtr
  91.         StartSound, StopSound, SoundDone
  92. }
  93. {
  94.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95.    constants
  96.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. }
  98. CONST twelfthRootTwo = 1.05946309435;
  99.  
  100.  
  101. CONST
  102.     soundListRsrc                = 'snd ';                        { Resource type used by Sound Manager }
  103.  
  104.     kSimpleBeepID                = 1;                            { reserved resource ID for Simple Beep }
  105.  
  106.     rate48khz                    = $BB800000;                    { 48000.00000 in fixed-point }
  107.     rate44khz                    = $AC440000;                    { 44100.00000 in fixed-point }
  108.     rate22050hz                    = $56220000;                    { 22050.00000 in fixed-point }
  109.     rate22khz                    = $56EE8BA3;                    { 22254.54545 in fixed-point }
  110.     rate11khz                    = $2B7745D1;                    { 11127.27273 in fixed-point }
  111.     rate11025hz                    = $2B110000;                    { 11025.00000 in fixed-point }
  112.  
  113.                                                                 { synthesizer numbers for SndNewChannel }
  114.     squareWaveSynth                = 1;                            { square wave synthesizer }
  115.     waveTableSynth                = 3;                            { wave table synthesizer }
  116.     sampledSynth                = 5;                            { sampled sound synthesizer }
  117.                                                                 { old Sound Manager MACE synthesizer numbers }
  118.     MACE3snthID                    = 11;
  119.     MACE6snthID                    = 13;
  120.  
  121.     kMiddleC                    = 60;                            { MIDI note value for middle C }
  122.  
  123.     kNoVolume                    = 0;                            { setting for no sound volume }
  124.     kFullVolume                    = $0100;                        { 1.0, setting for full hardware output volume }
  125.  
  126.     stdQLength                    = 128;
  127.  
  128.     dataOffsetFlag                = $8000;
  129.  
  130.     kUseOptionalOutputDevice    = -1;                            { only for Sound Manager 3.0 or later }
  131.  
  132.     notCompressed                = 0;                            { compression ID's }
  133.     fixedCompression            = -1;                            { compression ID for fixed-sized compression }
  134.     variableCompression            = -2;                            { compression ID for variable-sized compression }
  135.  
  136.     twoToOne                    = 1;
  137.     eightToThree                = 2;
  138.     threeToOne                    = 3;
  139.     sixToOne                    = 4;
  140.     sixToOnePacketSize            = 8;
  141.     threeToOnePacketSize        = 16;
  142.  
  143.     stateBlockSize                = 64;
  144.     leftOverBlockSize            = 32;
  145.  
  146.     firstSoundFormat            = $0001;                        { general sound format }
  147.     secondSoundFormat            = $0002;                        { special sampled sound format (HyperCard) }
  148.  
  149.     dbBufferReady                = $00000001;                    { double buffer is filled }
  150.     dbLastBuffer                = $00000004;                    { last double buffer to play }
  151.  
  152.     sysBeepDisable                = $0000;                        { SysBeep() enable flags }
  153.     sysBeepEnable                = $01;
  154.     sysBeepSynchronous            = $02;                            { if bit set, make alert sounds synchronous }
  155.  
  156.     unitTypeNoSelection            = $FFFF;                        { unitTypes for AudioSelection.unitType }
  157.     unitTypeSeconds                = $0000;
  158.  
  159.     stdSH                        = $00;                            { Standard sound header encode value }
  160.     extSH                        = $FF;                            { Extended sound header encode value }
  161.     cmpSH                        = $FE;                            { Compressed sound header encode value }
  162.  
  163. {command numbers for SndDoCommand and SndDoImmediate}
  164.     nullCmd                        = 0;
  165.     initCmd                        = 1;
  166.     freeCmd                        = 2;
  167.     quietCmd                    = 3;
  168.     flushCmd                    = 4;
  169.     reInitCmd                    = 5;
  170.     waitCmd                        = 10;
  171.     pauseCmd                    = 11;
  172.     resumeCmd                    = 12;
  173.     callBackCmd                    = 13;
  174.     syncCmd                        = 14;
  175.     availableCmd                = 24;
  176.     versionCmd                    = 25;
  177.     totalLoadCmd                = 26;
  178.     loadCmd                        = 27;
  179.     freqDurationCmd                = 40;
  180.     restCmd                        = 41;
  181.     freqCmd                        = 42;
  182.     ampCmd                        = 43;
  183.     timbreCmd                    = 44;
  184.     getAmpCmd                    = 45;
  185.     volumeCmd                    = 46;                            { sound manager 3.0 or later only }
  186.     getVolumeCmd                = 47;                            { sound manager 3.0 or later only }
  187.     clockComponentCmd            = 50;                            { sound manager 3.2.1 or later only }
  188.     getClockComponentCmd        = 51;                            { sound manager 3.2.1 or later only }
  189.     scheduledSoundCmd            = 52;                            { sound manager 3.3 or later only }
  190.     linkSoundComponentsCmd        = 53;                            { sound manager 3.3 or later only }
  191.     waveTableCmd                = 60;
  192.     phaseCmd                    = 61;
  193.     soundCmd                    = 80;
  194.     bufferCmd                    = 81;
  195.     rateCmd                        = 82;
  196.     continueCmd                    = 83;
  197.     doubleBufferCmd                = 84;
  198.     getRateCmd                    = 85;
  199.     rateMultiplierCmd            = 86;
  200.     getRateMultiplierCmd        = 87;
  201.     sizeCmd                        = 90;                            { obsolete command }
  202.     convertCmd                    = 91;                            { obsolete MACE command }
  203.  
  204. {$IFC OLDROUTINENAMES }
  205. {channel initialization parameters}
  206.     waveInitChannelMask            = $07;
  207.     waveInitChannel0            = $04;                            { wave table only, Sound Manager 2.0 and earlier }
  208.     waveInitChannel1            = $05;                            { wave table only, Sound Manager 2.0 and earlier }
  209.     waveInitChannel2            = $06;                            { wave table only, Sound Manager 2.0 and earlier }
  210.     waveInitChannel3            = $07;                            { wave table only, Sound Manager 2.0 and earlier }
  211.     initChan0                    = $04;                            { obsolete spelling }
  212.     initChan1                    = $05;                            { obsolete spelling }
  213.     initChan2                    = $06;                            { obsolete spelling }
  214.     initChan3                    = $07;                            { obsolete spelling }
  215.  
  216.     outsideCmpSH                = 0;                            { obsolete MACE constant }
  217.     insideCmpSH                    = 1;                            { obsolete MACE constant }
  218.     aceSuccess                    = 0;                            { obsolete MACE constant }
  219.     aceMemFull                    = 1;                            { obsolete MACE constant }
  220.     aceNilBlock                    = 2;                            { obsolete MACE constant }
  221.     aceBadComp                    = 3;                            { obsolete MACE constant }
  222.     aceBadEncode                = 4;                            { obsolete MACE constant }
  223.     aceBadDest                    = 5;                            { obsolete MACE constant }
  224.     aceBadCmd                    = 6;                            { obsolete MACE constant }
  225.  
  226. {$ENDC}  {OLDROUTINENAMES}
  227.  
  228.     initChanLeft                = $0002;                        { left stereo channel }
  229.     initChanRight                = $0003;                        { right stereo channel }
  230.     initNoInterp                = $0004;                        { no linear interpolation }
  231.     initNoDrop                    = $0008;                        { no drop-sample conversion }
  232.     initMono                    = $0080;                        { monophonic channel }
  233.     initStereo                    = $00C0;                        { stereo channel }
  234.     initMACE3                    = $0300;                        { MACE 3:1 }
  235.     initMACE6                    = $0400;                        { MACE 6:1 }
  236.     initPanMask                    = $0003;                        { mask for right/left pan values }
  237.     initSRateMask                = $0030;                        { mask for sample rate values }
  238.     initStereoMask                = $00C0;                        { mask for mono/stereo values }
  239.     initCompMask                = $FF00;                        { mask for compression IDs }
  240.  
  241. {Get&Set Sound Information Selectors}
  242.     siActiveChannels            = 'chac';                        { active channels }
  243.     siActiveLevels                = 'lmac';                        { active meter levels }
  244.     siAGCOnOff                    = 'agc ';                        { automatic gain control state }
  245.     siAsync                        = 'asyn';                        { asynchronous capability }
  246.     siAVDisplayBehavior            = 'avdb';
  247.     siChannelAvailable            = 'chav';                        { number of channels available }
  248.     siCompressionAvailable        = 'cmav';                        { compression types available }
  249.     siCompressionChannels        = 'cpct';                        { compressor's number of channels }
  250.     siCompressionFactor            = 'cmfa';                        { current compression factor }
  251.     siCompressionHeader            = 'cmhd';                        { return compression header }
  252.     siCompressionNames            = 'cnam';                        { compression type names available }
  253.     siCompressionParams            = 'evaw';                        { compression parameters }
  254.     siCompressionSampleRate        = 'cprt';                        { compressor's sample rate }
  255.     siCompressionType            = 'comp';                        { current compression type }
  256.     siContinuous                = 'cont';                        { continous recording }
  257.     siDecompressionParams        = 'wave';                        { decompression parameters }
  258.     siDeviceBufferInfo            = 'dbin';                        { size of interrupt buffer }
  259.     siDeviceConnected            = 'dcon';                        { input device connection status }
  260.     siDeviceIcon                = 'icon';                        { input device icon }
  261.     siDeviceName                = 'name';                        { input device name }
  262.     siHardwareBalance            = 'hbal';
  263.     siHardwareBalanceSteps        = 'hbls';
  264.     siHardwareBass                = 'hbas';
  265.     siHardwareBassSteps            = 'hbst';
  266.     siHardwareBusy                = 'hwbs';                        { sound hardware is in use }
  267.     siHardwareFormat            = 'hwfm';                        { get hardware format }
  268.     siHardwareMute                = 'hmut';                        { mute state of all hardware }
  269.     siHardwareTreble            = 'htrb';
  270.     siHardwareTrebleSteps        = 'hwts';
  271.     siHardwareVolume            = 'hvol';                        { volume level of all hardware }
  272.     siHardwareVolumeSteps        = 'hstp';                        { number of volume steps for hardware }
  273.     siHeadphoneMute                = 'pmut';                        { mute state of headphones }
  274.     siHeadphoneVolume            = 'pvol';                        { volume level of headphones }
  275.     siHeadphoneVolumeSteps        = 'hdst';                        { number of volume steps for headphones }
  276.     siInputAvailable            = 'inav';                        { input sources available }
  277.     siInputGain                    = 'gain';                        { input gain }
  278.     siInputSource                = 'sour';                        { input source selector }
  279.     siInputSourceNames            = 'snam';                        { input source names }
  280.     siLevelMeterOnOff            = 'lmet';                        { level meter state }
  281.     siModemGain                    = 'mgai';                        { modem input gain }
  282.     siMonitorAvailable            = 'mnav';
  283.     siMonitorSource                = 'mons';
  284.     siNumberChannels            = 'chan';                        { current number of channels }
  285.     siOptionsDialog                = 'optd';                        { display options dialog }
  286.     siOSTypeInputSource            = 'inpt';                        { input source by OSType }
  287.     siOSTypeInputAvailable        = 'inav';                        { list of available input source OSTypes }
  288.     siPlayThruOnOff                = 'plth';                        { playthrough state }
  289.     siPostMixerSoundComponent    = 'psmx';                        { install post-mixer effect }
  290.     siPreMixerSoundComponent    = 'prmx';                        { install pre-mixer effect }
  291.     siQuality                    = 'qual';                        { quality setting }
  292.     siRateMultiplier            = 'rmul';                        { throttle rate setting }
  293.     siRecordingQuality            = 'qual';                        { recording quality }
  294.     siSampleRate                = 'srat';                        { current sample rate }
  295.     siSampleRateAvailable        = 'srav';                        { sample rates available }
  296.     siSampleSize                = 'ssiz';                        { current sample size }
  297.     siSampleSizeAvailable        = 'ssav';                        { sample sizes available }
  298.     siSetupCDAudio                = 'sucd';                        { setup sound hardware for CD audio }
  299.     siSetupModemAudio            = 'sumd';                        { setup sound hardware for modem audio }
  300.     siSlopeAndIntercept            = 'flap';                        { floating point variables for conversion }
  301.     siSoundClock                = 'sclk';
  302.     siUseThisSoundClock            = 'sclc';                        { sdev uses this to tell the mixer to use his sound clock }
  303.     siSpeakerMute                = 'smut';                        { mute state of all built-in speaker }
  304.     siSpeakerVolume                = 'svol';                        { volume level of built-in speaker }
  305.     siSSpCPULoadLimit            = '3dll';
  306.     siSSpLocalization            = '3dif';
  307.     siSSpSpeakerSetup            = '3dst';
  308.     siStereoInputGain            = 'sgai';                        { stereo input gain }
  309.     siSubwooferMute                = 'bmut';                        { mute state of sub-woofer }
  310.     siTwosComplementOnOff        = 'twos';                        { two's complement state }
  311.     siVolume                    = 'volu';                        { volume level of source }
  312.     siVoxRecordInfo                = 'voxr';                        { VOX record parameters }
  313.     siVoxStopInfo                = 'voxs';                        { VOX stop parameters }
  314.     siWideStereo                = 'wide';                        { wide stereo setting }
  315.  
  316.     siCloseDriver                = 'clos';                        { reserved for internal use only }
  317.     siInitializeDriver            = 'init';                        { reserved for internal use only }
  318.     siPauseRecording            = 'paus';                        { reserved for internal use only }
  319.     siUserInterruptProc            = 'user';                        { reserved for internal use only }
  320.  
  321. {  input source Types }
  322.     kInvalidSource                = $FFFFFFFF;                    { this source may be returned from GetInfo if no other source is the monitored source }
  323.     kNoSource                    = 'none';                        { no source selection }
  324.     kCDSource                    = 'cd  ';                        { internal CD player input }
  325.     kExtMicSource                = 'emic';                        { external mic input }
  326.     kSoundInSource                = 'sinj';                        { sound input jack }
  327.     kRCAInSource                = 'irca';                        { RCA jack input }
  328.     kTVFMTunerSource            = 'tvfm';
  329.     kDAVInSource                = 'idav';                        { DAV analog input }
  330.     kIntMicSource                = 'imic';                        { internal mic input }
  331.     kMediaBaySource                = 'mbay';                        { media bay input }
  332.     kModemSource                = 'modm';                        { modem input (internal modem on desktops, PCI input on PowerBooks) }
  333.     kPCCardSource                = 'pcm ';                        { PC Card pwm input }
  334.     kZoomVideoSource            = 'zvpc';                        { zoom video input }
  335.     kDVDSource                    = 'dvda';                        { DVD audio input }
  336.  
  337. { Sound Component Types and Subtypes }
  338.     kNoSoundComponentType        = '****';
  339.     kSoundComponentType            = 'sift';                        { component type }
  340.     kSoundComponentPPCType        = 'nift';                        { component type for PowerPC code }
  341.     kRate8SubType                = 'ratb';                        { 8-bit rate converter }
  342.     kRate16SubType                = 'ratw';                        { 16-bit rate converter }
  343.     kConverterSubType            = 'conv';                        { sample format converter }
  344.     kSndSourceSubType            = 'sour';                        { generic source component }
  345.     kMixerType                    = 'mixr';
  346.     kMixer8SubType                = 'mixb';                        { 8-bit mixer }
  347.     kMixer16SubType                = 'mixw';                        { 16-bit mixer }
  348.     kSoundInputDeviceType        = 'sinp';                        { sound input component }
  349.     kWaveInSubType                = 'wavi';                        { Windows Wave }
  350.     kSoundOutputDeviceType        = 'sdev';                        { sound output component }
  351.     kClassicSubType                = 'clas';                        { classic hardware, i.e. Mac Plus }
  352.     kASCSubType                    = 'asc ';                        { Apple Sound Chip device }
  353.     kDSPSubType                    = 'dsp ';                        { DSP device }
  354.     kAwacsSubType                = 'awac';                        { Another of Will's Audio Chips device }
  355.     kGCAwacsSubType                = 'awgc';                        { Awacs audio with Grand Central DMA }
  356.     kSingerSubType                = 'sing';                        { Singer (via Whitney) based sound }
  357.     kSinger2SubType                = 'sng2';                        { Singer 2 (via Whitney) for Acme }
  358.     kWhitSubType                = 'whit';                        { Whit sound component for PrimeTime 3 }
  359.     kSoundBlasterSubType        = 'sbls';                        { Sound Blaster for CHRP }
  360.     kWaveOutSubType                = 'wavo';                        { Windows Wave }
  361.     kDirectSoundSubType            = 'dsnd';                        { Direct Sound }
  362.     kUNIXsdevSubType            = 'un1x';                        { UNIX base sdev }
  363.     kSoundCompressor            = 'scom';
  364.     kSoundDecompressor            = 'sdec';
  365.     kAudioComponentType            = 'adio';                        { Audio components and sub-types }
  366.     kAwacsPhoneSubType            = 'hphn';
  367.     kAudioVisionSpeakerSubType    = 'telc';
  368.     kAudioVisionHeadphoneSubType = 'telh';
  369.     kPhilipsFaderSubType        = 'tvav';
  370.     kSGSToneSubType                = 'sgs0';
  371.     kSoundEffectsType            = 'snfx';                        { sound effects type }
  372.     kSSpLocalizationSubType        = 'snd3';
  373.  
  374. { Format Types }
  375.     kSoundNotCompressed            = 'NONE';                        { sound is not compressed }
  376.     k8BitOffsetBinaryFormat        = 'raw ';                        { 8-bit offset binary }
  377.     k16BitBigEndianFormat        = 'twos';                        { 16-bit big endian }
  378.     k16BitLittleEndianFormat    = 'sowt';                        { 16-bit little endian }
  379.     kFloat32Format                = 'fl32';                        { 32-bit floating point }
  380.     kFloat64Format                = 'fl64';                        { 64-bit floating point }
  381.     k24BitFormat                = 'in24';                        { 24-bit integer }
  382.     k32BitFormat                = 'in32';                        { 32-bit integer }
  383.     kMACE3Compression            = 'MAC3';                        { MACE 3:1 }
  384.     kMACE6Compression            = 'MAC6';                        { MACE 6:1 }
  385.     kCDXA4Compression            = 'cdx4';                        { CD/XA 4:1 }
  386.     kCDXA2Compression            = 'cdx2';                        { CD/XA 2:1 }
  387.     kIMACompression                = 'ima4';                        { IMA 4:1 }
  388.     kULawCompression            = 'ulaw';                        { µLaw 2:1 }
  389.     kALawCompression            = 'alaw';                        { aLaw 2:1 }
  390.     kMicrosoftADPCMFormat        = $6D730002;                    { Microsoft ADPCM - ACM code 2 }
  391.     kDVIIntelIMAFormat            = $6D730011;                    { DVI/Intel IMA ADPCM - ACM code 17 }
  392.     kDVAudioFormat                = 'dvca';                        { DV Audio }
  393.     kQDesignCompression            = 'QDMC';                        { QDesign music }
  394.     kQUALCOMMCompression        = 'Qclp';                        { QUALCOMM PureVoice }
  395.     kOffsetBinary                = 'raw ';                        { for compatibility }
  396.     kTwosComplement                = 'twos';                        { for compatibility }
  397.     kLittleEndianFormat            = 'sowt';                        { for compatibility }
  398.  
  399. {$IFC TARGET_RT_LITTLE_ENDIAN }
  400.     k16BitNativeEndianFormat    = 'sowt';
  401.     k16BitNonNativeEndianFormat    = 'twos';
  402.  
  403. {$ELSEC}
  404.     k16BitNativeEndianFormat    = 'twos';
  405.     k16BitNonNativeEndianFormat    = 'sowt';
  406.  
  407. {$ENDC}  {TARGET_RT_LITTLE_ENDIAN}
  408.  
  409. { Features Flags }
  410.     k8BitRawIn                    = $01;                            { data description }
  411.     k8BitTwosIn                    = $02;
  412.     k16BitIn                    = $04;
  413.     kStereoIn                    = $08;
  414.     k8BitRawOut                    = $0100;
  415.     k8BitTwosOut                = $0200;
  416.     k16BitOut                    = $0400;
  417.     kStereoOut                    = $0800;
  418.     kReverse                    = $00010000;                    {   function description }
  419.     kRateConvert                = $00020000;
  420.     kCreateSoundSource            = $00040000;
  421.     kHighQuality                = $00400000;                    {   performance description }
  422.     kNonRealTime                = $00800000;
  423.  
  424. { SoundComponentPlaySourceBuffer action flags }
  425.     kSourcePaused                = $01;
  426.     kPassThrough                = $00010000;
  427.     kNoSoundComponentChain        = $00020000;
  428.  
  429. { SoundParamBlock flags, usefull for OpenMixerSoundComponent }
  430.     kNoMixing                    = $01;                            { don't mix source }
  431.     kNoSampleRateConversion        = $02;                            { don't convert sample rate (i.e. 11 kHz -> 22 kHz) }
  432.     kNoSampleSizeConversion        = $04;                            { don't convert sample size (i.e. 16 -> 8) }
  433.     kNoSampleFormatConversion    = $08;                            { don't convert sample format (i.e. 'twos' -> 'raw ') }
  434.     kNoChannelConversion        = $10;                            { don't convert stereo/mono }
  435.     kNoDecompression            = $20;                            { don't decompress (i.e. 'MAC3' -> 'raw ') }
  436.     kNoVolumeConversion            = $40;                            { don't apply volume }
  437.     kNoRealtimeProcessing        = $80;                            { won't run at interrupt time }
  438.     kScheduledSource            = $0100;                        { source is scheduled }
  439.  
  440. { SoundParamBlock quality settings }
  441.     kBestQuality                = $01;                            { use interpolation in rate conversion }
  442.  
  443. { useful bit masks }
  444.     kInputMask                    = $000000FF;                    { masks off input bits }
  445.     kOutputMask                    = $0000FF00;                    { masks off output bits }
  446.     kOutputShift                = 8;                            { amount output bits are shifted }
  447.     kActionMask                    = $00FF0000;                    { masks off action bits }
  448.     kSoundComponentBits            = $00FFFFFF;
  449.  
  450. { audio atom types }
  451.     kAudioFormatAtomType        = 'frma';
  452.     kAudioEndianAtomType        = 'enda';
  453.     kAudioTerminatorAtomType    = 0;
  454.  
  455. { siAVDisplayBehavior types }
  456.     kAVDisplayHeadphoneRemove    = 0;                            {  monitor does not have a headphone attached }
  457.     kAVDisplayHeadphoneInsert    = 1;                            {  monitor has a headphone attached }
  458.     kAVDisplayPlainTalkRemove    = 2;                            {  monitor either sending no input through CPU input port or unable to tell if input is coming in }
  459.     kAVDisplayPlainTalkInsert    = 3;                            {  monitor sending PlainTalk level microphone source input through sound input port }
  460.  
  461. { Audio Component constants }
  462.                                                                 { Values for whichChannel parameter }
  463.     audioAllChannels            = 0;                            { All channels (usually interpreted as both left and right) }
  464.     audioLeftChannel            = 1;                            { Left channel }
  465.     audioRightChannel            = 2;                            { Right channel }
  466.                                                                 { Values for mute parameter }
  467.     audioUnmuted                = 0;                            { Device is unmuted }
  468.     audioMuted                    = 1;                            { Device is muted }
  469.                                                                 { Capabilities flags definitions }
  470.     audioDoesMono                = $00000001;                    { Device supports mono output }
  471.     audioDoesStereo                = $00000002;                    { Device supports stereo output }
  472.     audioDoesIndependentChannels = $00000004;                    { Device supports independent software control of each channel }
  473.  
  474. {Sound Input Qualities}
  475.     siCDQuality                    = 'cd  ';                        { 44.1kHz, stereo, 16 bit }
  476.     siBestQuality                = 'best';                        { 22kHz, mono, 8 bit }
  477.     siBetterQuality                = 'betr';                        { 22kHz, mono, MACE 3:1 }
  478.     siGoodQuality                = 'good';                        { 22kHz, mono, MACE 6:1 }
  479.     siNoneQuality                = 'none';                        { settings don't match any quality for a get call }
  480.  
  481.     siDeviceIsConnected            = 1;                            { input device is connected and ready for input }
  482.     siDeviceNotConnected        = 0;                            { input device is not connected }
  483.     siDontKnowIfConnected        = -1;                            { can't tell if input device is connected }
  484.     siReadPermission            = 0;                            { permission passed to SPBOpenDevice }
  485.     siWritePermission            = 1;                            { permission passed to SPBOpenDevice }
  486.  
  487. {
  488.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  489.    typedefs
  490.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  491. }
  492.  
  493.  
  494. TYPE
  495.     SndCommandPtr = ^SndCommand;
  496.     SndCommand = PACKED RECORD
  497.         cmd:                    UInt16;
  498.         param1:                    INTEGER;
  499.         param2:                    LONGINT;
  500.     END;
  501.  
  502.     SndChannelPtr = ^SndChannel;
  503. {$IFC TYPED_FUNCTION_POINTERS}
  504.     SndCallBackProcPtr = PROCEDURE(chan: SndChannelPtr; VAR cmd: SndCommand);
  505. {$ELSEC}
  506.     SndCallBackProcPtr = ProcPtr;
  507. {$ENDC}
  508.  
  509.     SndCallBackUPP = UniversalProcPtr;
  510.     SndChannel = PACKED RECORD
  511.         nextChan:                SndChannelPtr;
  512.         firstMod:                Ptr;                                    {  reserved for the Sound Manager  }
  513.         callBack:                SndCallBackUPP;
  514.         userInfo:                LONGINT;
  515.         wait:                    LONGINT;                                {  The following is for internal Sound Manager use only. }
  516.         cmdInProgress:            SndCommand;
  517.         flags:                    INTEGER;
  518.         qLength:                INTEGER;
  519.         qHead:                    INTEGER;
  520.         qTail:                    INTEGER;
  521.         queue:                    ARRAY [0..127] OF SndCommand;
  522.     END;
  523.  
  524. {MACE structures}
  525.     StateBlockPtr = ^StateBlock;
  526.     StateBlock = RECORD
  527.         stateVar:                ARRAY [0..63] OF INTEGER;
  528.     END;
  529.  
  530.     LeftOverBlockPtr = ^LeftOverBlock;
  531.     LeftOverBlock = RECORD
  532.         count:                    UInt32;
  533.         sampleArea:                ARRAY [0..31] OF SInt8;
  534.     END;
  535.  
  536.     ModRefPtr = ^ModRef;
  537.     ModRef = RECORD
  538.         modNumber:                UInt16;
  539.         modInit:                LONGINT;
  540.     END;
  541.  
  542.     SndListResourcePtr = ^SndListResource;
  543.     SndListResource = RECORD
  544.         format:                    INTEGER;
  545.         numModifiers:            INTEGER;
  546.         modifierPart:            ARRAY [0..0] OF ModRef;
  547.         numCommands:            INTEGER;
  548.         commandPart:            ARRAY [0..0] OF SndCommand;
  549.         dataPart:                SInt8;
  550.     END;
  551.  
  552.     SndListPtr                            = ^SndListResource;
  553.     SndListHandle                        = ^SndListPtr;
  554.     SndListHndl                            = SndListHandle;
  555. {HyperCard sound resource format}
  556.     Snd2ListResourcePtr = ^Snd2ListResource;
  557.     Snd2ListResource = RECORD
  558.         format:                    INTEGER;
  559.         refCount:                INTEGER;
  560.         numCommands:            INTEGER;
  561.         commandPart:            ARRAY [0..0] OF SndCommand;
  562.         dataPart:                SInt8;
  563.     END;
  564.  
  565.     Snd2ListPtr                            = ^Snd2ListResource;
  566.     Snd2ListHandle                        = ^Snd2ListPtr;
  567.     Snd2ListHndl                        = Snd2ListHandle;
  568.     SoundHeaderPtr = ^SoundHeader;
  569.     SoundHeader = PACKED RECORD
  570.         samplePtr:                Ptr;                                    { if NIL then samples are in sampleArea }
  571.         length:                    UInt32;                                    { length of sound in bytes }
  572.         sampleRate:                UnsignedFixed;                            { sample rate for this sound }
  573.         loopStart:                UInt32;                                    { start of looping portion }
  574.         loopEnd:                UInt32;                                    { end of looping portion }
  575.         encode:                    UInt8;                                    { header encoding }
  576.         baseFrequency:            UInt8;                                    { baseFrequency value }
  577.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  578.     END;
  579.  
  580.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  581.     CmpSoundHeader = PACKED RECORD
  582.         samplePtr:                Ptr;                                    { if nil then samples are in sample area }
  583.         numChannels:            UInt32;                                    { number of channels i.e. mono = 1 }
  584.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  585.         loopStart:                UInt32;                                    { loopStart of sound before compression }
  586.         loopEnd:                UInt32;                                    { loopEnd of sound before compression }
  587.         encode:                    UInt8;                                    { data structure used , stdSH, extSH, or cmpSH }
  588.         baseFrequency:            UInt8;                                    { same meaning as regular SoundHeader }
  589.         numFrames:                UInt32;                                    { length in frames ( packetFrames or sampleFrames ) }
  590.         AIFFSampleRate:            extended80;                                { IEEE sample rate }
  591.         markerChunk:            Ptr;                                    { sync track }
  592.         format:                    OSType;                                    { data format type, was futureUse1 }
  593.         futureUse2:                UInt32;                                    { reserved by Apple }
  594.         stateVars:                StateBlockPtr;                            { pointer to State Block }
  595.         leftOverSamples:        LeftOverBlockPtr;                        { used to save truncated samples between compression calls }
  596.         compressionID:            INTEGER;                                { 0 means no compression, non zero means compressionID }
  597.         packetSize:                UInt16;                                    { number of bits in compressed sample packet }
  598.         snthID:                    UInt16;                                    { resource ID of Sound Manager snth that contains NRT C/E }
  599.         sampleSize:                UInt16;                                    { number of bits in non-compressed sample }
  600.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  601.     END;
  602.  
  603.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  604.     ExtSoundHeader = PACKED RECORD
  605.         samplePtr:                Ptr;                                    { if nil then samples are in sample area }
  606.         numChannels:            UInt32;                                    { number of channels,  ie mono = 1 }
  607.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  608.         loopStart:                UInt32;                                    { same meaning as regular SoundHeader }
  609.         loopEnd:                UInt32;                                    { same meaning as regular SoundHeader }
  610.         encode:                    UInt8;                                    { data structure used , stdSH, extSH, or cmpSH }
  611.         baseFrequency:            UInt8;                                    { same meaning as regular SoundHeader }
  612.         numFrames:                UInt32;                                    { length in total number of frames }
  613.         AIFFSampleRate:            extended80;                                { IEEE sample rate }
  614.         markerChunk:            Ptr;                                    { sync track }
  615.         instrumentChunks:        Ptr;                                    { AIFF instrument chunks }
  616.         AESRecording:            Ptr;
  617.         sampleSize:                UInt16;                                    { number of bits in sample }
  618.         futureUse1:                UInt16;                                    { reserved by Apple }
  619.         futureUse2:                UInt32;                                    { reserved by Apple }
  620.         futureUse3:                UInt32;                                    { reserved by Apple }
  621.         futureUse4:                UInt32;                                    { reserved by Apple }
  622.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  623.     END;
  624.  
  625.     SoundHeaderUnionPtr = ^SoundHeaderUnion;
  626.     SoundHeaderUnion = RECORD
  627.         CASE INTEGER OF
  628.         0: (
  629.             stdHeader:            SoundHeader;
  630.             );
  631.         1: (
  632.             cmpHeader:            CmpSoundHeader;
  633.             );
  634.         2: (
  635.             extHeader:            ExtSoundHeader;
  636.             );
  637.     END;
  638.  
  639.     ConversionBlockPtr = ^ConversionBlock;
  640.     ConversionBlock = RECORD
  641.         destination:            INTEGER;
  642.         unused:                    INTEGER;
  643.         inputPtr:                CmpSoundHeaderPtr;
  644.         outputPtr:                CmpSoundHeaderPtr;
  645.     END;
  646.  
  647. {  ScheduledSoundHeader flags }
  648.  
  649. CONST
  650.     kScheduledSoundDoScheduled    = $01;
  651.     kScheduledSoundDoCallBack    = $02;
  652.  
  653.  
  654. TYPE
  655.     ScheduledSoundHeaderPtr = ^ScheduledSoundHeader;
  656.     ScheduledSoundHeader = RECORD
  657.         u:                        SoundHeaderUnion;
  658.         flags:                    LONGINT;
  659.         reserved:                INTEGER;
  660.         callBackParam1:            INTEGER;
  661.         callBackParam2:            LONGINT;
  662.         startTime:                TimeRecord;
  663.     END;
  664.  
  665.     SMStatusPtr = ^SMStatus;
  666.     SMStatus = PACKED RECORD
  667.         smMaxCPULoad:            INTEGER;
  668.         smNumChannels:            INTEGER;
  669.         smCurCPULoad:            INTEGER;
  670.     END;
  671.  
  672.     SCStatusPtr = ^SCStatus;
  673.     SCStatus = RECORD
  674.         scStartTime:            UnsignedFixed;
  675.         scEndTime:                UnsignedFixed;
  676.         scCurrentTime:            UnsignedFixed;
  677.         scChannelBusy:            BOOLEAN;
  678.         scChannelDisposed:        BOOLEAN;
  679.         scChannelPaused:        BOOLEAN;
  680.         scUnused:                BOOLEAN;
  681.         scChannelAttributes:    UInt32;
  682.         scCPULoad:                LONGINT;
  683.     END;
  684.  
  685.     AudioSelectionPtr = ^AudioSelection;
  686.     AudioSelection = PACKED RECORD
  687.         unitType:                LONGINT;
  688.         selStart:                UnsignedFixed;
  689.         selEnd:                    UnsignedFixed;
  690.     END;
  691.  
  692.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  693.     SndDoubleBuffer = PACKED RECORD
  694.         dbNumFrames:            LONGINT;
  695.         dbFlags:                LONGINT;
  696.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  697.         dbSoundData:            ARRAY [0..0] OF SInt8;
  698.     END;
  699.  
  700. {$IFC TYPED_FUNCTION_POINTERS}
  701.     SndDoubleBackProcPtr = PROCEDURE(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr);
  702. {$ELSEC}
  703.     SndDoubleBackProcPtr = ProcPtr;
  704. {$ENDC}
  705.  
  706.     SndDoubleBackUPP = UniversalProcPtr;
  707.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  708.     SndDoubleBufferHeader = PACKED RECORD
  709.         dbhNumChannels:            INTEGER;
  710.         dbhSampleSize:            INTEGER;
  711.         dbhCompressionID:        INTEGER;
  712.         dbhPacketSize:            INTEGER;
  713.         dbhSampleRate:            UnsignedFixed;
  714.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  715.         dbhDoubleBack:            SndDoubleBackUPP;
  716.     END;
  717.  
  718.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  719.     SndDoubleBufferHeader2 = PACKED RECORD
  720.         dbhNumChannels:            INTEGER;
  721.         dbhSampleSize:            INTEGER;
  722.         dbhCompressionID:        INTEGER;
  723.         dbhPacketSize:            INTEGER;
  724.         dbhSampleRate:            UnsignedFixed;
  725.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  726.         dbhDoubleBack:            SndDoubleBackUPP;
  727.         dbhFormat:                OSType;
  728.     END;
  729.  
  730.     SoundInfoListPtr = ^SoundInfoList;
  731.     SoundInfoList = PACKED RECORD
  732.         count:                    INTEGER;
  733.         infoHandle:                Handle;
  734.     END;
  735.  
  736.     SoundComponentDataPtr = ^SoundComponentData;
  737.     SoundComponentData = RECORD
  738.         flags:                    LONGINT;
  739.         format:                    OSType;
  740.         numChannels:            INTEGER;
  741.         sampleSize:                INTEGER;
  742.         sampleRate:                UnsignedFixed;
  743.         sampleCount:            LONGINT;
  744.         buffer:                    Ptr;
  745.         reserved:                LONGINT;
  746.     END;
  747.  
  748.     SoundParamBlockPtr = ^SoundParamBlock;
  749. {$IFC TYPED_FUNCTION_POINTERS}
  750.     SoundParamProcPtr = FUNCTION(VAR pb: SoundParamBlockPtr): BOOLEAN;
  751. {$ELSEC}
  752.     SoundParamProcPtr = ProcPtr;
  753. {$ENDC}
  754.  
  755.     SoundParamUPP = UniversalProcPtr;
  756.     SoundParamBlock = RECORD
  757.         recordSize:                LONGINT;                                { size of this record in bytes }
  758.         desc:                    SoundComponentData;                        { description of sound buffer }
  759.         rateMultiplier:            UnsignedFixed;                            { rate multiplier to apply to sound }
  760.         leftVolume:                INTEGER;                                { volumes to apply to sound }
  761.         rightVolume:            INTEGER;
  762.         quality:                LONGINT;                                { quality to apply to sound }
  763.         filter:                    ComponentInstance;                        { filter to apply to sound }
  764.         moreRtn:                SoundParamUPP;                            { routine to call to get more data }
  765.         completionRtn:            SoundParamUPP;                            { routine to call when buffer is complete }
  766.         refCon:                    LONGINT;                                { user refcon }
  767.         result:                    INTEGER;                                { result }
  768.     END;
  769.  
  770.     CompressionInfoPtr = ^CompressionInfo;
  771.     CompressionInfo = RECORD
  772.         recordSize:                LONGINT;
  773.         format:                    OSType;
  774.         compressionID:            INTEGER;
  775.         samplesPerPacket:        UInt16;
  776.         bytesPerPacket:            UInt16;
  777.         bytesPerFrame:            UInt16;
  778.         bytesPerSample:            UInt16;
  779.         futureUse1:                UInt16;
  780.     END;
  781.  
  782.     CompressionInfoHandle                = ^CompressionInfoPtr;
  783. { variables for floating point conversion }
  784.     SoundSlopeAndInterceptRecordPtr = ^SoundSlopeAndInterceptRecord;
  785.     SoundSlopeAndInterceptRecord = RECORD
  786.         slope:                    Float64;
  787.         intercept:                Float64;
  788.         minClip:                Float64;
  789.         maxClip:                Float64;
  790.     END;
  791.  
  792.     SoundSlopeAndInterceptPtr            = ^SoundSlopeAndInterceptRecord;
  793. { private thing to use as a reference to a Sound Converter }
  794.     SoundConverter = ^LONGINT;
  795. { private thing to use as a reference to a Sound Source }
  796.     SoundSource = ^LONGINT;
  797.     SoundSourcePtr                        = ^SoundSource;
  798.     SoundComponentLinkPtr = ^SoundComponentLink;
  799.     SoundComponentLink = RECORD
  800.         description:            ComponentDescription;                    { Describes the sound component }
  801.         mixerID:                SoundSource;                            { Reserved by Apple }
  802.         linkID:                    SoundSourcePtr;                            { Reserved by Apple }
  803.     END;
  804.  
  805.     AudioInfoPtr = ^AudioInfo;
  806.     AudioInfo = RECORD
  807.         capabilitiesFlags:        LONGINT;                                { Describes device capabilities }
  808.         reserved:                LONGINT;                                { Reserved by Apple }
  809.         numVolumeSteps:            UInt16;                                    { Number of significant increments between min and max volume }
  810.     END;
  811.  
  812.     AudioFormatAtomPtr = ^AudioFormatAtom;
  813.     AudioFormatAtom = RECORD
  814.         size:                    LONGINT;                                {  = sizeof(AudioFormatAtom) }
  815.         atomType:                OSType;                                    {  = kAudioFormatAtomType }
  816.         format:                    OSType;
  817.     END;
  818.  
  819.     AudioEndianAtomPtr = ^AudioEndianAtom;
  820.     AudioEndianAtom = RECORD
  821.         size:                    LONGINT;                                {  = sizeof(AudioEndianAtom) }
  822.         atomType:                OSType;                                    {  = kAudioEndianAtomType }
  823.         littleEndian:            INTEGER;
  824.     END;
  825.  
  826.     AudioTerminatorAtomPtr = ^AudioTerminatorAtom;
  827.     AudioTerminatorAtom = RECORD
  828.         size:                    LONGINT;                                {  = sizeof(AudioTerminatorAtom) }
  829.         atomType:                OSType;                                    {  = kAudioTerminatorAtomType }
  830.     END;
  831.  
  832. {  Sound Input Structures }
  833.     SPBPtr = ^SPB;
  834. {user procedures called by sound input routines}
  835. {$IFC TYPED_FUNCTION_POINTERS}
  836.     SIInterruptProcPtr = PROCEDURE(inParamPtr: SPBPtr; dataBuffer: Ptr; peakAmplitude: INTEGER; sampleSize: LONGINT);
  837. {$ELSEC}
  838.     SIInterruptProcPtr = Register68kProcPtr;
  839. {$ENDC}
  840.  
  841. {$IFC TYPED_FUNCTION_POINTERS}
  842.     FilePlayCompletionProcPtr = PROCEDURE(chan: SndChannelPtr);
  843. {$ELSEC}
  844.     FilePlayCompletionProcPtr = ProcPtr;
  845. {$ENDC}
  846.  
  847. {$IFC TYPED_FUNCTION_POINTERS}
  848.     SICompletionProcPtr = PROCEDURE(inParamPtr: SPBPtr);
  849. {$ELSEC}
  850.     SICompletionProcPtr = ProcPtr;
  851. {$ENDC}
  852.  
  853.     SIInterruptUPP = UniversalProcPtr;
  854.     FilePlayCompletionUPP = UniversalProcPtr;
  855.     SICompletionUPP = UniversalProcPtr;
  856. {Sound Input Parameter Block}
  857.     SPB = RECORD
  858.         inRefNum:                LONGINT;                                { reference number of sound input device }
  859.         count:                    UInt32;                                    { number of bytes to record }
  860.         milliseconds:            UInt32;                                    { number of milliseconds to record }
  861.         bufferLength:            UInt32;                                    { length of buffer in bytes }
  862.         bufferPtr:                Ptr;                                    { buffer to store sound data in }
  863.         completionRoutine:        SICompletionUPP;                        { completion routine }
  864.         interruptRoutine:        SIInterruptUPP;                            { interrupt routine }
  865.         userLong:                LONGINT;                                { user-defined field }
  866.         error:                    OSErr;                                    { error }
  867.         unused1:                LONGINT;                                { reserved - must be zero }
  868.     END;
  869.  
  870. {
  871.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  872.    prototypes
  873.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  874. }
  875.  
  876. {
  877.    These two routines for Get/SetSoundVol should no longer be used.
  878.    They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  879.    Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  880. }
  881.  
  882. {$IFC TARGET_CPU_68K }
  883. PROCEDURE SetSoundVol(level: INTEGER);
  884.  
  885. PROCEDURE GetSoundVol(VAR level: INTEGER);
  886.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  887.     INLINE $205F, $4218, $10B8, $0260;
  888.     {$ENDC}
  889. {$ENDC}  {TARGET_CPU_68K}
  890.  
  891. { Sound Manager routines }
  892. PROCEDURE SysBeep(duration: INTEGER);
  893.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  894.     INLINE $A9C8;
  895.     {$ENDC}
  896. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  897.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  898.     INLINE $A803;
  899.     {$ENDC}
  900. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  901.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  902.     INLINE $A804;
  903.     {$ENDC}
  904. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  905.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  906.     INLINE $A807;
  907.     {$ENDC}
  908. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  909.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  910.     INLINE $A801;
  911.     {$ENDC}
  912. FUNCTION SndPlay(chan: SndChannelPtr; sndHandle: SndListHandle; async: BOOLEAN): OSErr;
  913.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  914.     INLINE $A805;
  915.     {$ENDC}
  916. {$IFC OLDROUTINENAMES }
  917. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  918.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  919.     INLINE $A802;
  920.     {$ENDC}
  921. {$ENDC}  {OLDROUTINENAMES}
  922.  
  923. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  924.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  925.     INLINE $A806;
  926.     {$ENDC}
  927. { Sound Manager 2.0 and later, uses _SoundDispatch }
  928. FUNCTION SndSoundManagerVersion: NumVersion;
  929.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  930.     INLINE $203C, $000C, $0008, $A800;
  931.     {$ENDC}
  932. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  933.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  934.     INLINE $203C, $0D00, $0008, $A800;
  935.     {$ENDC}
  936. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  937.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  938.     INLINE $203C, $0204, $0008, $A800;
  939.     {$ENDC}
  940. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  941.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  942.     INLINE $203C, $0308, $0008, $A800;
  943.     {$ENDC}
  944. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  945.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  946.     INLINE $203C, $0510, $0008, $A800;
  947.     {$ENDC}
  948. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  949.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  950.     INLINE $203C, $0314, $0008, $A800;
  951.     {$ENDC}
  952. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  953.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  954.     INLINE $203C, $0218, $0008, $A800;
  955.     {$ENDC}
  956. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  957.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  958.     INLINE $203C, $011C, $0008, $A800;
  959.     {$ENDC}
  960. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  961.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  962.     INLINE $203C, $0420, $0008, $A800;
  963.     {$ENDC}
  964. { MACE compression routines, uses _SoundDispatch }
  965. FUNCTION MACEVersion: NumVersion;
  966.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  967.     INLINE $203C, $0000, $0010, $A800;
  968.     {$ENDC}
  969. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: UInt32; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: UInt32; whichChannel: UInt32);
  970.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  971.     INLINE $203C, $0004, $0010, $A800;
  972.     {$ENDC}
  973. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: UInt32; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: UInt32; whichChannel: UInt32);
  974.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  975.     INLINE $203C, $0008, $0010, $A800;
  976.     {$ENDC}
  977. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: UInt32; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: UInt32; whichChannel: UInt32);
  978.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  979.     INLINE $203C, $000C, $0010, $A800;
  980.     {$ENDC}
  981. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: UInt32; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: UInt32; whichChannel: UInt32);
  982.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  983.     INLINE $203C, $0010, $0010, $A800;
  984.     {$ENDC}
  985. { Sound Manager 3.0 and later calls, uses _SoundDispatch }
  986. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  987.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  988.     INLINE $203C, $0224, $0018, $A800;
  989.     {$ENDC}
  990. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  991.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  992.     INLINE $203C, $0228, $0018, $A800;
  993.     {$ENDC}
  994. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  995.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  996.     INLINE $203C, $022C, $0018, $A800;
  997.     {$ENDC}
  998. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  999.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1000.     INLINE $203C, $0230, $0018, $A800;
  1001.     {$ENDC}
  1002. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  1003.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1004.     INLINE $203C, $0404, $0018, $A800;
  1005.     {$ENDC}
  1006. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  1007.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1008.     INLINE $203C, $060C, $0018, $A800;
  1009.     {$ENDC}
  1010. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  1011.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1012.     INLINE $203C, $0710, $0018, $A800;
  1013.     {$ENDC}
  1014. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  1015.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1016.     INLINE $203C, $0634, $0018, $A800;
  1017.     {$ENDC}
  1018. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  1019.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1020.     INLINE $203C, $0638, $0018, $A800;
  1021.     {$ENDC}
  1022. FUNCTION OpenMixerSoundComponent(outputDescription: SoundComponentDataPtr; outputFlags: LONGINT; VAR mixerComponent: ComponentInstance): OSErr;
  1023.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1024.     INLINE $203C, $0614, $0018, $A800;
  1025.     {$ENDC}
  1026. FUNCTION CloseMixerSoundComponent(ci: ComponentInstance): OSErr;
  1027.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1028.     INLINE $203C, $0218, $0018, $A800;
  1029.     {$ENDC}
  1030. { Sound Manager 3.1 and later calls, uses _SoundDispatch }
  1031. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  1032.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1033.     INLINE $203C, $063C, $0018, $A800;
  1034.     {$ENDC}
  1035. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  1036.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1037.     INLINE $203C, $0640, $0018, $A800;
  1038.     {$ENDC}
  1039. FUNCTION GetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  1040.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1041.     INLINE $203C, $0644, $0018, $A800;
  1042.     {$ENDC}
  1043. FUNCTION SetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  1044.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1045.     INLINE $203C, $0648, $0018, $A800;
  1046.     {$ENDC}
  1047. { Sound Manager 3.2 and later calls, uses _SoundDispatch }
  1048. FUNCTION GetCompressionName(compressionType: OSType; VAR compressionName: Str255): OSErr;
  1049.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1050.     INLINE $203C, $044C, $0018, $A800;
  1051.     {$ENDC}
  1052. FUNCTION SoundConverterOpen({CONST}VAR inputFormat: SoundComponentData; {CONST}VAR outputFormat: SoundComponentData; VAR sc: SoundConverter): OSErr;
  1053.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1054.     INLINE $203C, $0650, $0018, $A800;
  1055.     {$ENDC}
  1056. FUNCTION SoundConverterClose(sc: SoundConverter): OSErr;
  1057.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1058.     INLINE $203C, $0254, $0018, $A800;
  1059.     {$ENDC}
  1060. FUNCTION SoundConverterGetBufferSizes(sc: SoundConverter; inputBytesTarget: UInt32; VAR inputFrames: UInt32; VAR inputBytes: UInt32; VAR outputBytes: UInt32): OSErr;
  1061.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1062.     INLINE $203C, $0A58, $0018, $A800;
  1063.     {$ENDC}
  1064. FUNCTION SoundConverterBeginConversion(sc: SoundConverter): OSErr;
  1065.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1066.     INLINE $203C, $025C, $0018, $A800;
  1067.     {$ENDC}
  1068. FUNCTION SoundConverterConvertBuffer(sc: SoundConverter; inputPtr: UNIV Ptr; inputFrames: UInt32; outputPtr: UNIV Ptr; VAR outputFrames: UInt32; VAR outputBytes: UInt32): OSErr;
  1069.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1070.     INLINE $203C, $0C60, $0018, $A800;
  1071.     {$ENDC}
  1072. FUNCTION SoundConverterEndConversion(sc: SoundConverter; outputPtr: UNIV Ptr; VAR outputFrames: UInt32; VAR outputBytes: UInt32): OSErr;
  1073.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1074.     INLINE $203C, $0864, $0018, $A800;
  1075.     {$ENDC}
  1076. { Sound Manager 3.3 and later calls, uses _SoundDispatch }
  1077. FUNCTION SoundConverterGetInfo(sc: SoundConverter; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  1078.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1079.     INLINE $203C, $0668, $0018, $A800;
  1080.     {$ENDC}
  1081. FUNCTION SoundConverterSetInfo(sc: SoundConverter; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  1082.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1083.     INLINE $203C, $066C, $0018, $A800;
  1084.     {$ENDC}
  1085. {
  1086.   Sound Component Functions
  1087.    basic sound component functions
  1088. }
  1089.  
  1090. FUNCTION SoundComponentInitOutputDevice(ti: ComponentInstance; actions: LONGINT): ComponentResult;
  1091.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1092.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  1093.     {$ENDC}
  1094. FUNCTION SoundComponentSetSource(ti: ComponentInstance; sourceID: SoundSource; source: ComponentInstance): ComponentResult;
  1095.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1096.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  1097.     {$ENDC}
  1098. FUNCTION SoundComponentGetSource(ti: ComponentInstance; sourceID: SoundSource; VAR source: ComponentInstance): ComponentResult;
  1099.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1100.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  1101.     {$ENDC}
  1102. FUNCTION SoundComponentGetSourceData(ti: ComponentInstance; VAR sourceData: SoundComponentDataPtr): ComponentResult;
  1103.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1104.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  1105.     {$ENDC}
  1106. FUNCTION SoundComponentSetOutput(ti: ComponentInstance; requested: SoundComponentDataPtr; VAR actual: SoundComponentDataPtr): ComponentResult;
  1107.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1108.     INLINE $2F3C, $0008, $0005, $7000, $A82A;
  1109.     {$ENDC}
  1110. {  junction methods for the mixer, must be called at non-interrupt level }
  1111. FUNCTION SoundComponentAddSource(ti: ComponentInstance; VAR sourceID: SoundSource): ComponentResult;
  1112.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1113.     INLINE $2F3C, $0004, $0101, $7000, $A82A;
  1114.     {$ENDC}
  1115. FUNCTION SoundComponentRemoveSource(ti: ComponentInstance; sourceID: SoundSource): ComponentResult;
  1116.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1117.     INLINE $2F3C, $0004, $0102, $7000, $A82A;
  1118.     {$ENDC}
  1119. {  info methods }
  1120. FUNCTION SoundComponentGetInfo(ti: ComponentInstance; sourceID: SoundSource; selector: OSType; infoPtr: UNIV Ptr): ComponentResult;
  1121.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1122.     INLINE $2F3C, $000C, $0103, $7000, $A82A;
  1123.     {$ENDC}
  1124. FUNCTION SoundComponentSetInfo(ti: ComponentInstance; sourceID: SoundSource; selector: OSType; infoPtr: UNIV Ptr): ComponentResult;
  1125.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1126.     INLINE $2F3C, $000C, $0104, $7000, $A82A;
  1127.     {$ENDC}
  1128. {  control methods }
  1129. FUNCTION SoundComponentStartSource(ti: ComponentInstance; count: INTEGER; VAR sources: SoundSource): ComponentResult;
  1130.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1131.     INLINE $2F3C, $0006, $0105, $7000, $A82A;
  1132.     {$ENDC}
  1133. FUNCTION SoundComponentStopSource(ti: ComponentInstance; count: INTEGER; VAR sources: SoundSource): ComponentResult;
  1134.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1135.     INLINE $2F3C, $0006, $0106, $7000, $A82A;
  1136.     {$ENDC}
  1137. FUNCTION SoundComponentPauseSource(ti: ComponentInstance; count: INTEGER; VAR sources: SoundSource): ComponentResult;
  1138.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1139.     INLINE $2F3C, $0006, $0107, $7000, $A82A;
  1140.     {$ENDC}
  1141. FUNCTION SoundComponentPlaySourceBuffer(ti: ComponentInstance; sourceID: SoundSource; pb: SoundParamBlockPtr; actions: LONGINT): ComponentResult;
  1142.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1143.     INLINE $2F3C, $000C, $0108, $7000, $A82A;
  1144.     {$ENDC}
  1145. { Audio Components }
  1146. {Volume is described as a value between 0 and 1, with 0 indicating minimum
  1147.   volume and 1 indicating maximum volume; if the device doesn't support
  1148.   software control of volume, then a value of unimpErr is returned, indicating
  1149.   that these functions are not supported by the device}
  1150. FUNCTION AudioGetVolume(ac: ComponentInstance; whichChannel: INTEGER; VAR volume: ShortFixed): ComponentResult;
  1151.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1152.     INLINE $2F3C, $0006, $0000, $7000, $A82A;
  1153.     {$ENDC}
  1154. FUNCTION AudioSetVolume(ac: ComponentInstance; whichChannel: INTEGER; volume: ShortFixed): ComponentResult;
  1155.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1156.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  1157.     {$ENDC}
  1158. {If the device doesn't support software control of mute, then a value of unimpErr is
  1159. returned, indicating that these functions are not supported by the device.}
  1160. FUNCTION AudioGetMute(ac: ComponentInstance; whichChannel: INTEGER; VAR mute: INTEGER): ComponentResult;
  1161.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1162.     INLINE $2F3C, $0006, $0002, $7000, $A82A;
  1163.     {$ENDC}
  1164. FUNCTION AudioSetMute(ac: ComponentInstance; whichChannel: INTEGER; mute: INTEGER): ComponentResult;
  1165.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1166.     INLINE $2F3C, $0004, $0003, $7000, $A82A;
  1167.     {$ENDC}
  1168. {AudioSetToDefaults causes the associated device to reset its volume and mute values
  1169. (and perhaps other characteristics, e.g. attenuation) to "factory default" settings}
  1170. FUNCTION AudioSetToDefaults(ac: ComponentInstance): ComponentResult;
  1171.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1172.     INLINE $2F3C, $0000, $0004, $7000, $A82A;
  1173.     {$ENDC}
  1174. { This routine is required; it must be implemented by all audio components }
  1175.  
  1176. FUNCTION AudioGetInfo(ac: ComponentInstance; info: AudioInfoPtr): ComponentResult;
  1177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1178.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1179.     {$ENDC}
  1180. FUNCTION AudioGetBass(ac: ComponentInstance; whichChannel: INTEGER; VAR bass: INTEGER): ComponentResult;
  1181.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1182.     INLINE $2F3C, $0006, $0006, $7000, $A82A;
  1183.     {$ENDC}
  1184. FUNCTION AudioSetBass(ac: ComponentInstance; whichChannel: INTEGER; bass: INTEGER): ComponentResult;
  1185.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1186.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1187.     {$ENDC}
  1188. FUNCTION AudioGetTreble(ac: ComponentInstance; whichChannel: INTEGER; VAR Treble: INTEGER): ComponentResult;
  1189.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1190.     INLINE $2F3C, $0006, $0008, $7000, $A82A;
  1191.     {$ENDC}
  1192. FUNCTION AudioSetTreble(ac: ComponentInstance; whichChannel: INTEGER; Treble: INTEGER): ComponentResult;
  1193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1194.     INLINE $2F3C, $0004, $0009, $7000, $A82A;
  1195.     {$ENDC}
  1196. FUNCTION AudioGetOutputDevice(ac: ComponentInstance; VAR outputDevice: Component): ComponentResult;
  1197.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1198.     INLINE $2F3C, $0004, $000A, $7000, $A82A;
  1199.     {$ENDC}
  1200.  
  1201. { This is routine is private to the AudioVision component.  It enables the watching of the mute key. }
  1202. FUNCTION AudioMuteOnEvent(ac: ComponentInstance; muteOnEvent: INTEGER): ComponentResult;
  1203.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1204.     INLINE $2F3C, $0002, $0081, $7000, $A82A;
  1205.     {$ENDC}
  1206.  
  1207. CONST
  1208.     kDelegatedSoundComponentSelectors = $0100;
  1209.  
  1210. { Sound Input Manager routines, uses _SoundDispatch }
  1211. FUNCTION SPBVersion: NumVersion;
  1212.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1213.     INLINE $203C, $0000, $0014, $A800;
  1214.     {$ENDC}
  1215. FUNCTION SndRecord(filterProc: ModalFilterUPP; corner: Point; quality: OSType; VAR sndHandle: SndListHandle): OSErr;
  1216.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1217.     INLINE $203C, $0804, $0014, $A800;
  1218.     {$ENDC}
  1219. FUNCTION SndRecordToFile(filterProc: ModalFilterUPP; corner: Point; quality: OSType; fRefNum: INTEGER): OSErr;
  1220.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1221.     INLINE $203C, $0708, $0014, $A800;
  1222.     {$ENDC}
  1223. FUNCTION SPBSignInDevice(deviceRefNum: INTEGER; deviceName: Str255): OSErr;
  1224.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1225.     INLINE $203C, $030C, $0014, $A800;
  1226.     {$ENDC}
  1227. FUNCTION SPBSignOutDevice(deviceRefNum: INTEGER): OSErr;
  1228.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1229.     INLINE $203C, $0110, $0014, $A800;
  1230.     {$ENDC}
  1231. FUNCTION SPBGetIndexedDevice(count: INTEGER; VAR deviceName: Str255; VAR deviceIconHandle: Handle): OSErr;
  1232.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1233.     INLINE $203C, $0514, $0014, $A800;
  1234.     {$ENDC}
  1235. FUNCTION SPBOpenDevice(deviceName: Str255; permission: INTEGER; VAR inRefNum: LONGINT): OSErr;
  1236.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1237.     INLINE $203C, $0518, $0014, $A800;
  1238.     {$ENDC}
  1239. FUNCTION SPBCloseDevice(inRefNum: LONGINT): OSErr;
  1240.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1241.     INLINE $203C, $021C, $0014, $A800;
  1242.     {$ENDC}
  1243. FUNCTION SPBRecord(inParamPtr: SPBPtr; asynchFlag: BOOLEAN): OSErr;
  1244.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1245.     INLINE $203C, $0320, $0014, $A800;
  1246.     {$ENDC}
  1247. FUNCTION SPBRecordToFile(fRefNum: INTEGER; inParamPtr: SPBPtr; asynchFlag: BOOLEAN): OSErr;
  1248.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1249.     INLINE $203C, $0424, $0014, $A800;
  1250.     {$ENDC}
  1251. FUNCTION SPBPauseRecording(inRefNum: LONGINT): OSErr;
  1252.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1253.     INLINE $203C, $0228, $0014, $A800;
  1254.     {$ENDC}
  1255. FUNCTION SPBResumeRecording(inRefNum: LONGINT): OSErr;
  1256.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1257.     INLINE $203C, $022C, $0014, $A800;
  1258.     {$ENDC}
  1259. FUNCTION SPBStopRecording(inRefNum: LONGINT): OSErr;
  1260.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1261.     INLINE $203C, $0230, $0014, $A800;
  1262.     {$ENDC}
  1263. FUNCTION SPBGetRecordingStatus(inRefNum: LONGINT; VAR recordingStatus: INTEGER; VAR meterLevel: INTEGER; VAR totalSamplesToRecord: UInt32; VAR numberOfSamplesRecorded: UInt32; VAR totalMsecsToRecord: UInt32; VAR numberOfMsecsRecorded: UInt32): OSErr;
  1264.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1265.     INLINE $203C, $0E34, $0014, $A800;
  1266.     {$ENDC}
  1267. FUNCTION SPBGetDeviceInfo(inRefNum: LONGINT; infoType: OSType; infoData: UNIV Ptr): OSErr;
  1268.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1269.     INLINE $203C, $0638, $0014, $A800;
  1270.     {$ENDC}
  1271. FUNCTION SPBSetDeviceInfo(inRefNum: LONGINT; infoType: OSType; infoData: UNIV Ptr): OSErr;
  1272.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1273.     INLINE $203C, $063C, $0014, $A800;
  1274.     {$ENDC}
  1275. FUNCTION SPBMillisecondsToBytes(inRefNum: LONGINT; VAR milliseconds: LONGINT): OSErr;
  1276.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1277.     INLINE $203C, $0440, $0014, $A800;
  1278.     {$ENDC}
  1279. FUNCTION SPBBytesToMilliseconds(inRefNum: LONGINT; VAR byteCount: LONGINT): OSErr;
  1280.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1281.     INLINE $203C, $0444, $0014, $A800;
  1282.     {$ENDC}
  1283. FUNCTION SetupSndHeader(sndHandle: SndListHandle; numChannels: INTEGER; sampleRate: UnsignedFixed; sampleSize: INTEGER; compressionType: OSType; baseNote: INTEGER; numBytes: UInt32; VAR headerLen: INTEGER): OSErr;
  1284.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1285.     INLINE $203C, $0D48, $0014, $A800;
  1286.     {$ENDC}
  1287. FUNCTION SetupAIFFHeader(fRefNum: INTEGER; numChannels: INTEGER; sampleRate: UnsignedFixed; sampleSize: INTEGER; compressionType: OSType; numBytes: UInt32; numFrames: UInt32): OSErr;
  1288.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1289.     INLINE $203C, $0B4C, $0014, $A800;
  1290.     {$ENDC}
  1291. { Sound Input Manager 1.1 and later calls, uses _SoundDispatch }
  1292. FUNCTION ParseAIFFHeader(fRefNum: INTEGER; VAR sndInfo: SoundComponentData; VAR numFrames: UInt32; VAR dataOffset: UInt32): OSErr;
  1293.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1294.     INLINE $203C, $0758, $0014, $A800;
  1295.     {$ENDC}
  1296. FUNCTION ParseSndHeader(sndHandle: SndListHandle; VAR sndInfo: SoundComponentData; VAR numFrames: UInt32; VAR dataOffset: UInt32): OSErr;
  1297.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1298.     INLINE $203C, $085C, $0014, $A800;
  1299.     {$ENDC}
  1300.  
  1301. CONST
  1302.     uppSndCallBackProcInfo = $000003C0;
  1303.     uppSndDoubleBackProcInfo = $000003C0;
  1304.     uppSoundParamProcInfo = $000000D0;
  1305.     uppSIInterruptProcInfo = $1C579802;
  1306.     uppFilePlayCompletionProcInfo = $000000C0;
  1307.     uppSICompletionProcInfo = $000000C0;
  1308.  
  1309. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  1310.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1311.     INLINE $2E9F;
  1312.     {$ENDC}
  1313.  
  1314. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  1315.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1316.     INLINE $2E9F;
  1317.     {$ENDC}
  1318.  
  1319. FUNCTION NewSoundParamProc(userRoutine: SoundParamProcPtr): SoundParamUPP;
  1320.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1321.     INLINE $2E9F;
  1322.     {$ENDC}
  1323.  
  1324. FUNCTION NewSIInterruptProc(userRoutine: SIInterruptProcPtr): SIInterruptUPP;
  1325.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1326.     INLINE $2E9F;
  1327.     {$ENDC}
  1328.  
  1329. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  1330.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1331.     INLINE $2E9F;
  1332.     {$ENDC}
  1333.  
  1334. FUNCTION NewSICompletionProc(userRoutine: SICompletionProcPtr): SICompletionUPP;
  1335.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1336.     INLINE $2E9F;
  1337.     {$ENDC}
  1338.  
  1339. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  1340.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1341.     INLINE $205F, $4E90;
  1342.     {$ENDC}
  1343.  
  1344. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  1345.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1346.     INLINE $205F, $4E90;
  1347.     {$ENDC}
  1348.  
  1349. FUNCTION CallSoundParamProc(VAR pb: SoundParamBlockPtr; userRoutine: SoundParamUPP): BOOLEAN;
  1350.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1351.     INLINE $205F, $4E90;
  1352.     {$ENDC}
  1353.  
  1354. PROCEDURE CallSIInterruptProc(inParamPtr: SPBPtr; dataBuffer: Ptr; peakAmplitude: INTEGER; sampleSize: LONGINT; userRoutine: SIInterruptUPP);
  1355.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1356.     {To be implemented:  Glue to move parameters into registers.}
  1357.     {$ENDC}
  1358.  
  1359. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  1360.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1361.     INLINE $205F, $4E90;
  1362.     {$ENDC}
  1363.  
  1364. PROCEDURE CallSICompletionProc(inParamPtr: SPBPtr; userRoutine: SICompletionUPP);
  1365.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1366.     INLINE $205F, $4E90;
  1367.     {$ENDC}
  1368. {$IFC NOT TARGET_OS_MAC }
  1369. {  Only to be used if you are writing a sound input component; this }
  1370. {  is the param block for a read request from the SoundMgr to the   }
  1371. {  sound input component.  Not to be confused with the SPB struct   }
  1372. {  above, which is the param block for a read request from an app   }
  1373. {  to the SoundMgr.                                                 }
  1374.  
  1375. TYPE
  1376.     SndInputCmpParamPtr = ^SndInputCmpParam;
  1377. {$IFC TYPED_FUNCTION_POINTERS}
  1378.     SICCompletionProcPtr = PROCEDURE(SICParmPtr: SndInputCmpParamPtr);
  1379. {$ELSEC}
  1380.     SICCompletionProcPtr = ProcPtr;
  1381. {$ENDC}
  1382.  
  1383.     SndInputCmpParam = RECORD
  1384.         ioCompletion:            SICCompletionProcPtr;                    {  completion routine [pointer] }
  1385.         ioInterrupt:            SIInterruptProcPtr;                        {  interrupt routine [pointer] }
  1386.         ioResult:                OSErr;                                    {  I/O result code [word] }
  1387.         pad:                    INTEGER;
  1388.         ioReqCount:                UInt32;
  1389.         ioActCount:                UInt32;
  1390.         ioBuffer:                Ptr;
  1391.         ioMisc:                    Ptr;
  1392.     END;
  1393.  
  1394. FUNCTION SndInputReadAsync(self: ComponentInstance; SICParmPtr: SndInputCmpParamPtr): ComponentResult;
  1395.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1396.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  1397.     {$ENDC}
  1398. FUNCTION SndInputReadSync(self: ComponentInstance; SICParmPtr: SndInputCmpParamPtr): ComponentResult;
  1399.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1400.     INLINE $2F3C, $0004, $0002, $7000, $A82A;
  1401.     {$ENDC}
  1402. FUNCTION SndInputPauseRecording(self: ComponentInstance): ComponentResult;
  1403.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1404.     INLINE $2F3C, $0000, $0003, $7000, $A82A;
  1405.     {$ENDC}
  1406. FUNCTION SndInputResumeRecording(self: ComponentInstance): ComponentResult;
  1407.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1408.     INLINE $2F3C, $0000, $0004, $7000, $A82A;
  1409.     {$ENDC}
  1410. FUNCTION SndInputStopRecording(self: ComponentInstance): ComponentResult;
  1411.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1412.     INLINE $2F3C, $0000, $0005, $7000, $A82A;
  1413.     {$ENDC}
  1414. FUNCTION SndInputGetStatus(self: ComponentInstance; VAR recordingStatus: INTEGER; VAR totalSamplesToRecord: UInt32; VAR numberOfSamplesRecorded: UInt32): ComponentResult;
  1415.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1416.     INLINE $2F3C, $000C, $0006, $7000, $A82A;
  1417.     {$ENDC}
  1418. FUNCTION SndInputGetDeviceInfo(self: ComponentInstance; infoType: OSType; infoData: UNIV Ptr): ComponentResult;
  1419.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1420.     INLINE $2F3C, $0008, $0007, $7000, $A82A;
  1421.     {$ENDC}
  1422. FUNCTION SndInputSetDeviceInfo(self: ComponentInstance; infoType: OSType; infoData: UNIV Ptr): ComponentResult;
  1423.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1424.     INLINE $2F3C, $0008, $0008, $7000, $A82A;
  1425.     {$ENDC}
  1426. FUNCTION SndInputInitHardware(self: ComponentInstance): ComponentResult;
  1427.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1428.     INLINE $2F3C, $0000, $0009, $7000, $A82A;
  1429.     {$ENDC}
  1430.  
  1431. CONST
  1432.     uppSICCompletionProcInfo = $000000C0;
  1433.  
  1434. FUNCTION NewSICCompletionProc(userRoutine: SICCompletionProcPtr): SICCompletionUPP;
  1435.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1436.     INLINE $2E9F;
  1437.     {$ENDC}
  1438.  
  1439. PROCEDURE CallSICCompletionProc(SICParmPtr: SndInputCmpParamPtr; userRoutine: SICCompletionUPP);
  1440.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1441.     INLINE $205F, $4E90;
  1442.     {$ENDC}
  1443. {$ENDC}
  1444.  
  1445.  
  1446. {$ALIGN RESET}
  1447. {$POP}
  1448.  
  1449. {$SETC UsingIncludes := SoundIncludes}
  1450.  
  1451. {$ENDC} {__SOUND__}
  1452.  
  1453. {$IFC NOT UsingIncludes}
  1454.  END.
  1455. {$ENDC}
  1456.